package com.turing.usdtpay.entity;

import android.support.annotation.NonNull;

/**
 * @作者：JAY
 * @创建时间：2019/11/4 16:42
 * @描述：
 **/
public class NoticeData implements Comparable<NoticeData>{

    private int id;
    private String title;
    private int rank;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    @Override
    public String toString() {
        return "NoticeData{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", rank=" + rank +
                '}';
    }

    @Override
    public int compareTo(@NonNull NoticeData o) {
        if (o instanceof NoticeData){
            NoticeData data = o;
            if (this.rank > data.rank){
                return 1;
            }else if (this.rank < data.rank){
                return  -1;
            }else {
                return 0;
            }
        }
        return 0;
    }
}
